/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.tomasio.projects.welcome.model;

import com.tomasio.projects.welcome.dto.PeriodoDTO;
import java.util.Date;

/**
 *
 * @author administrador
 */
public class Periodo {
    private Date dataInicial;
    private Date dataFinal;

    public Periodo() {
    }

    public Periodo(Date dataInicial, Date dataFinal) {
        this.dataInicial = dataInicial;
        this.dataFinal = dataFinal;
    }

    public Periodo(PeriodoDTO dto) {
        if(dto != null){
            this.dataInicial = dto.getDataInicial();
            this.dataFinal = dto.getDataFinal();
        }
    }


    public Date getDataFinal() {
        return dataFinal;
    }

    public void setDataFinal(Date dataFinal) {
        this.dataFinal = dataFinal;
    }

    public Date getDataInicial() {
        return dataInicial;
    }

    public void setDataInicial(Date dataInicial) {
        this.dataInicial = dataInicial;
    }
    public PeriodoDTO createDTO(){
        PeriodoDTO dto = new PeriodoDTO();
        dto.setDataInicial(dataInicial);
        dto.setDataFinal(dataFinal);
        return dto;
    }
    
}
